-- =========================================
-- Author: Jacob Gable
-- Created: 02.00.2009
-- Notes: Creation of BlogPost table.
-- 
-- 
-- =========================================

IF OBJECT_ID('dbo.BlogPost', 'U') IS NOT NULL
  DROP TABLE dbo.BlogPost
GO

CREATE TABLE dbo.BlogPost
(
	PostId int identity(1,1) NOT NULL, 
	BlogId int foreign key references Blog(BlogId) NOT NULL, 
	Title nvarchar(1000) NOT NULL, 
	Contents nvarchar(max) NOT NULL,
	DatePosted datetime NOT NULL,
	Publish bit NOT NULL,	
	ts timestamp NULL,
    CONSTRAINT PK_BlogPost PRIMARY KEY (PostId)
)
GO
